set terminal pdf

file = "[1, 700]_"

f(x)=v*((x-h)**(k-1))*exp(-x/th)
v=75
h=2
k=2
th=33
fit f(x) file."klein_even" via v,h,k,th

set output "bultfitKE.pdf"
plot file."klein_even" title "klein even" lw 2, \
	f(x) title "fit" lw 2 lt 3
	
	
	
f(x)=v*((x-h)**(k-1))*exp(-x/th)
v=750
h=4
k=2
th=33
fit f(x) file."klein_oneven" via v,h,k,th

set output "bultfitKO.pdf"
plot file."klein_oneven" title "klein oneven" lw 2, \
	f(x) title "fit" lw 2 lt 3
	
	
	
f(x)=v*((x-h)**(k-1))*exp(-x/th)
v=8e18
h=1404
k=2
th=40.6288
fit f(x) file."groot_even" via v,h,k,th

set output "bultfitGE.pdf"
plot file."groot_even" title "groot even" lw 2, \
	f(x) title "fit" lw 2 lt 3
	
	
	
f(x)=v*((x-h)**(k-1))*exp(-x/th)
v=5e18
h=1404
k=2
th=32
fit f(x) file."groot_oneven" via v,h,k,th

set output "bultfitGO.pdf"
plot file."groot_oneven" title "groot oneven" lw 2, \
	f(x) title "fit" lw 2 lt 3
